<form id="add-form" class="form-horizontal service-agent-form" role="form" data-toggle="validator" method="POST"
      action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="radio" name="row[type]" value="1" checked/> 代理商
            <input type="radio" name="row[type]" value="2"/> 服务中心
            <input type="radio" name="row[type]" value="3"/> 服务站
        </div>
    </div>
    <div class="form-group" data-favisible="type=2,3">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="first,second">
                <select class="first form-control" name="row[pid][]" data-url="ajax/agent?pid=0"></select>
                <select data-favisible="type=3" class="second form-control" name="row[pid][]" data-url="ajax/agent"
                        data-query-name="pid"></select>
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" data-rule="required" class="form-control" name="row[phone]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">登录账号:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-admin_name" data-rule="required" class="form-control" name="row[admin_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-password" data-rule="required" class="form-control" name="row[password]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">地区</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist area" data-name="row[city]" data-template="areatpl" id="area-select">
                <dd>
                    <ins></ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                </dd>
                <textarea name="row[city]" class="form-control hide" cols="30" rows="5">[]</textarea>
            </dl>
            <!--定义模板，模板语法使用Art-Template模板语法-->
            <script type="text/html" id="areatpl">
                <dd class="form-inline">

                    <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
                        <select class="province form-control" name="area[<%=index%>][province]"
                                data-url="ajax/area"></select>
                        <select class="city form-control" name="area[<%=index%>][city]" data-url="ajax/area"
                                data-query-name="province"></select>
                        <select class="area form-control" name="area[<%=index%>][area]" data-url="ajax/area"
                                data-query-name="city"></select>
                    </div>

                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span
                        class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">产品检测分类</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <dl class="fieldlist product-category" data-name="row[city]" data-template="product-category-tpl"-->
<!--                id="product-category-select">-->
<!--                <dd>-->
<!--                    <ins></ins>-->
<!--                </dd>-->
<!--                <dd>-->
<!--                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>-->
<!--                </dd>-->
<!--                <textarea name="row[city]" class="form-control hide" cols="30" rows="5">[]</textarea>-->
<!--            </dl>-->
<!--            &lt;!&ndash;定义模板，模板语法使用Art-Template模板语法&ndash;&gt;-->
<!--            <script type="text/html" id="product-category-tpl">-->
<!--                <dd class="form-inline">-->

<!--                    <div class="form-inline" data-toggle="cxselect" data-selects="p1,p2">-->
<!--                        <select class="p1 form-control" data-url="ajax/zwacategory/type/product"></select>-->
<!--                        <select class="p2 form-control" name="product[<%=index%>]"-->
<!--                                data-url="ajax/zwacategory/type/product" data-query-name="pid"></select>-->
<!--                    </div>-->

<!--                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span-->
<!--                        class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>-->
<!--                </dd>-->
<!--            </script>-->
<!--        </div>-->
<!--    </div>-->




    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">企业名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" name="details[company_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">社会信用代码:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" name="details[credit_code]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">法人:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" name="details[legal_person]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label for="c-business_license" class="control-label col-xs-12 col-sm-2">营业执照:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-business_license" data-rule="" class="form-control" size="50" name="details[business_license]"
                       type="text"
                       value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-business_license" class="btn btn-danger faupload"
                                  data-input-id="c-business_license"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="false" data-preview-id="p-business_license"><i
                            class="fa fa-upload"></i> 上传</button></span>
                    <span><button type="button" id="fachoose-business_license" class="btn btn-primary fachoose"
                                  data-input-id="c-business_license" data-mimetype="image/*" data-multiple="false"><i
                            class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-business_license"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-business_license"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">企业地址:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" name="details[address]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">负责人姓名:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" name="details[agent_user_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">手机号:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-url="email" name="details[agent_mobile]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">邮箱:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-url="email" name="details[email]" type="text" value="">
        </div>
    </div>

    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">合同协议:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[contract_agreement]"
                       type="text"
                       value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload"
                                  data-input-id="c-avatar"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="true" data-preview-id="p-avatar"><i
                            class="fa fa-upload"></i> 上传</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose"
                                  data-input-id="c-avatar" data-mimetype="image/*" data-multiple="true"><i
                            class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
    </div>

    <div class="form-group">
        <label for="c-trademark" class="control-label col-xs-12 col-sm-2">商标:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-trademark" data-rule="" class="form-control" size="50" name="details[trademark]"
                       type="text"
                       value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-trademark" class="btn btn-danger faupload"
                                  data-input-id="c-trademark"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="true" data-preview-id="p-trademark"><i
                            class="fa fa-upload"></i> 上传</button></span>
                    <span><button type="button" id="fachoose-trademark" class="btn btn-primary fachoose"
                                  data-input-id="c-trademark" data-mimetype="image/*" data-multiple="true"><i
                            class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-trademark"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-trademark"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-certificate" class="control-label col-xs-12 col-sm-2">企业证书:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-certificate" data-rule="" class="form-control" size="50" name="details[certificate]"
                       type="text"
                       value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-certificate" class="btn btn-danger faupload"
                                  data-input-id="c-certificate"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="true" data-preview-id="p-certificate"><i
                            class="fa fa-upload"></i> 上传</button></span>
                    <span><button type="button" id="fachoose-certificate" class="btn btn-primary fachoose"
                                  data-input-id="c-certificate" data-mimetype="image/*" data-multiple="true"><i
                            class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-certificate"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-certificate"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-and_so_on" class="control-label col-xs-12 col-sm-2">其他材料:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-and_so_on" data-rule="" class="form-control" size="50" name="details[and_so_on]"
                       type="text"
                       value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-and_so_on" class="btn btn-danger faupload"
                                  data-input-id="c-and_so_on"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="true" data-preview-id="p-and_so_on"><i
                            class="fa fa-upload"></i> 上传</button></span>
                    <span><button type="button" id="fachoose-and_so_on" class="btn btn-primary fachoose"
                                  data-input-id="c-and_so_on" data-mimetype="image/*" data-multiple="true"><i
                            class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-and_so_on"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-and_so_on"></ul>
        </div>
    </div>
    <div style="width: 100%;margin:  0 auto">
        <div class="form-group">
            <label for="" class="control-label col-xs-12 col-sm-2">服务地址</label>
            <div class="col-xs-12 col-sm-8"><input type="text" class="form-control" name="row[address]" id="address"
                                                   placeholder="地址"></div>
        </div>
        <div class="form-group">
            <label for="" class="control-label col-xs-12 col-sm-2">经度</label>
            <div class="col-xs-12 col-sm-8"><input type="text" class="form-control" name="row[lng]" id="lng"
                                                   placeholder="经度"></div>

        </div>
        <div class="form-group">
            <label for="" class="control-label col-xs-12 col-sm-2">纬度</label>
            <div class="col-xs-12 col-sm-8">
                <input type="text" class="form-control" name="row[lat]" id="lat" placeholder="纬度">
            </div>

        </div>
        <!--    <div class="form-group">-->
        <!--        <label for=""></label>-->
        <!--        <input type="text" class="form-control" name="" id="zoom" placeholder="缩放">-->
        <!--    </div>-->
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button type="button" class="btn btn-primary" data-toggle='addresspicker' data-input-id="address"
                        data-lng-id="lng"
                        data-lat-id="lat" data-zoom-id="zoom">点击选择
                </button>
            </div>
        </div>

    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
